﻿#ifndef USERHOMEPAGE_H
#define USERHOMEPAGE_H

#include <QWidget>
#include "customtabstyle.h"
#include "globalvars.h"

namespace Ui {
class UserHomePage;
}

class UserHomePage : public QWidget
{
    Q_OBJECT
signals:
    void signalModifyHeadPic(const QString &path);
    void signalModifyPassword(QString oldPwd,QString newPwd);
    void signalUpdateUserInfos(const QStringList& msg);
    void signalBusinessManCertificate(const QString& realName,const QStringList& imageList);

public:
    explicit UserHomePage(QWidget *parent = nullptr);
    ~UserHomePage();

    void FailGainInfos(const QString& title, const QString& msg);
    void initUserInfos();

    void setHeadPic(const QImage& image);
    void businessManCertificateResult();

private slots:
    void on_pb_modifyHeadPic_clicked();
    void on_pb_modifyPassword_clicked();
    void on_pb_modifyPhone_clicked();
    void on_pb_modifyEmail_clicked();
    void on_pb_finish_clicked();

    void on_pb_upload1_clicked();
    void on_pb_upload2_clicked();
    void on_le_password_editingFinished();
    void on_le_newPassword_editingFinished();
    void on_le_newPasswordOK_textChanged(const QString &arg1);
    void on_le_name_editingFinished();

    void on_pb_submit_clicked();

private:
    Ui::UserHomePage *ui;
    int m_uploadCount;
    bool m_isOkToModifyPswd;
    bool m_isOkToModifyInfos;
    QVector<QString> m_imageVector;

    bool checkModifiedPhone();
    bool checkModifiedEmail();
};

#endif // USERHOMEPAGE_H
